package com.ptt.sqmonmobile;

import com.ptt.sqm.component.CustomSlidingDrawer;
import com.ptt.sqm.session.SavedAssessTran;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.widget.SlidingPaneLayout;
import android.util.AttributeSet;
import android.util.Log;
import android.view.DragEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnDragListener;
import android.view.View.OnGenericMotionListener;
import android.view.View.OnHoverListener;
import android.view.View.OnLayoutChangeListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.SlidingDrawer.OnDrawerCloseListener;
import android.widget.SlidingDrawer.OnDrawerOpenListener;
import android.widget.SlidingDrawer.OnDrawerScrollListener;
import android.widget.TextView;

public class TempActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_temp);

		CustomSlidingDrawer slide = (CustomSlidingDrawer) this
				.findViewById(R.id.slidingDrawer1);

		final LinearLayout grid = (LinearLayout) slide.findViewById(R.id.content);
		grid.setRotation(180);		
		slide.setRotation(180);
		grid.setVisibility(LinearLayout.VISIBLE);

		
		slide.setOnDrawerCloseListener(new OnDrawerCloseListener() {

			@Override
			public void onDrawerClosed() {
				// TODO Auto-generated method stub
				grid.setVisibility(LinearLayout.GONE);

			}
		});

//		slide.addOnLayoutChangeListener(new OnLayoutChangeListener() {
//
//			@Override
//			public void onLayoutChange(View arg0, int arg1, int arg2, int arg3,
//					int arg4, int arg5, int arg6, int arg7, int arg8) {
//				// TODO Auto-generated method stub
//				grid.setRotation(180);
//				grid.setVisibility(LinearLayout.VISIBLE);
//			}
//		});

		
		// Clear Test assessTran
		SavedAssessTran savedTranPref = new SavedAssessTran(this.getApplicationContext());
		savedTranPref.ClearSavedAssessTran("5003-00001_5036-00012");
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.temp, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

}
